Skip to content

Fix 3 d blox external spec#10107

Open
openroad-ci wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-3DBlox-external-spec
Open

Fix 3 d blox external spec#10107
openroad-ci wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-3DBlox-external-spec

Conversation

@openroad-ci

Copy link
Copy Markdown
Member

Fix the issue #10078

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the 3dblox parser and logic to handle external file definitions (DEF, Verilog, SDC) more robustly by treating them as lists and flagging multiple entries as errors. It also adds logic to track DEF file reading status to prevent redundant processing. The review feedback recommends improving property creation safety, using idiomatic vector assignment, and ensuring consistent error logging for multiple file entries across all parser sections where checks are currently missing.

Comment thread src/odb/src/3dblox/3dblox.cpp Outdated
chiplet.external.def_file.c_str(),
chip,
/*issue_callback*/ false);
odb::dbBoolProperty::create(chip, "def_file_read", true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is safer to check if the property already exists before creating it, especially since createChiplet might be called on an existing chip that already has this property set. This prevents potential errors or duplicate property creation.

    if (odb::dbProperty::find(chip, "def_file_read") == nullptr) {
      odb::dbBoolProperty::create(chip, "def_file_read", true);
    }

Comment thread src/odb/src/3dblox/3dblox.cpp Outdated
Comment on lines +688 to +693
std::vector<odb::dbLib*> search_libs;
for (odb::dbLib* lib : db_->getLibs()) {
search_libs.push_back(lib);
}
def_reader.readChip(
search_libs, chip_inst.external.def_file.c_str(), chip, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Per the general rules, use vector::assign() with iterators to copy elements from a dbSet to a std::vector instead of a manual loop. Additionally, adding the /*issue_callback*/ comment to the readChip call improves readability and maintains consistency with other parts of the codebase.

References
  1. To copy elements from a dbSet to a std::vector, use the vector::assign() method with iterators from the dbSet, as direct assignment is not supported.

Comment thread src/odb/src/3dblox/dbvParser.cpp Outdated
Comment on lines +196 to +198
if (!verilog_files.empty()) {
chiplet.external.verilog_file = resolvePath(verilog_files[0]);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add a check for multiple verilog_file entries and log it as an error. In this repository, error logs are terminal, ensuring the user is notified of the unsupported configuration before the program exits.

      if (verilog_files.size() > 1) {
        logError(
            "Multiple verilog_file entries for a single chiplet are currently "
            "unsupported.");
      }
      if (!verilog_files.empty()) {
        chiplet.external.verilog_file = resolvePath(verilog_files[0]);
      }
References
  1. Unexpected failures should be logged as an error, not a warning.
  2. Calls to logger_->error are expected to terminate the program, so additional error handling like returning an error code or throwing an exception is not necessary.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address

Comment thread src/odb/src/3dblox/dbxParser.cpp Outdated
Comment on lines +147 to +149
if (!verilog_files.empty()) {
external.verilog_file = resolvePath(verilog_files[0]);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add a check for multiple verilog_file entries for consistency. This should be logged as an error, which is terminal per repository guidelines.

Suggested change
if (!verilog_files.empty()) {
external.verilog_file = resolvePath(verilog_files[0]);
}
if (verilog_files.size() > 1) {
logError(
"Multiple verilog_file entries for a single chiplet are currently "
"unsupported.");
}
if (!verilog_files.empty()) {
external.verilog_file = resolvePath(verilog_files[0]);
}
References
  1. Unexpected failures should be logged as an error, not a warning.
  2. Calls to logger_->error are expected to terminate the program, so additional error handling like returning an error code or throwing an exception is not necessary.

Comment thread src/odb/src/3dblox/dbxParser.cpp Outdated
Comment on lines +155 to +157
if (!sdc_files.empty()) {
external.sdc_file = resolvePath(sdc_files[0]);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add a check for multiple sdc_file entries and log an error if found. Note that error logging will terminate the program execution.

Suggested change
if (!sdc_files.empty()) {
external.sdc_file = resolvePath(sdc_files[0]);
}
if (sdc_files.size() > 1) {
logError(
"Multiple sdc_file entries for a single chiplet are currently "
"unsupported.");
}
if (!sdc_files.empty()) {
external.sdc_file = resolvePath(sdc_files[0]);
}
References
  1. Unexpected failures should be logged as an error, not a warning.
  2. Calls to logger_->error are expected to terminate the program, so additional error handling like returning an error code or throwing an exception is not necessary.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/odb/src/3dblox/dbxParser.cpp Outdated
if (external_node["verilog_file"]) {
extractValue(external_node, "verilog_file", external.verilog_file);
external.verilog_file = resolvePath(external.verilog_file);
std::vector<std::string> verilog_files;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::vector" is directly included [misc-include-cleaner]

src/odb/src/3dblox/dbxParser.cpp:10:

+ #include <vector>

@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Comment thread src/odb/src/3dblox/dbvParser.cpp Outdated
Comment on lines +196 to +198
if (!verilog_files.empty()) {
chiplet.external.verilog_file = resolvePath(verilog_files[0]);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address

@github-actions github-actions Bot added size/M and removed size/S labels Apr 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

openroad-ci pushed a commit to The-OpenROAD-Project-staging/OpenROAD that referenced this pull request Apr 22, 2026
…ipletInst

Address review feedback on The-OpenROAD-Project#10107 (osamahammad21: "please address") asking
that the cardinality check applied to verilog_file in dbvParser.cpp and to
def_file in dbxParser.cpp be extended to the remaining external fields for
ChipletInst. Matches the behaviour requested by the 3DBlox external spec
tracked in The-OpenROAD-Project#10078.

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@openroad-ci openroad-ci requested a review from a team as a code owner May 21, 2026 20:01
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

…ect#10078)

Per the 3DBlox v3.0 spec, every argument inside an external block must be a
YAML list of strings (with wildcard expansion). Parse the single-cardinality
external keys (verilog_file/sdc_file/def_file in .3dbx; DEF_file/verilog_file
in .3dbv) through a shared extractSinglePathFromList helper that expands
wildcards via resolvePaths and rejects more than one resolved file. Emit these
keys as YAML lists on write for round-trip consistency.

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
@openroad-ci openroad-ci force-pushed the fix-3DBlox-external-spec branch from dbafce3 to a8dcfe0 Compare June 18, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants